<?php
class Prof_Form_Attrib extends Zend_Form{
	public function __construct($sect,$qcmArr){
		parent::__construct(null);
		$this->setMethod('post');
		
		$qcm = new Zend_Form_Element_Select('id_qcm');
		$qcm	->setLabel('Quiz')
					->setRequired(true)
					->addValidator(new Zend_Validate_NotEmpty())
					->setMultiOptions($qcmArr);
		$this->addElement($qcm);
		
		$section = new Zend_Form_Element_Select('id_section');
		$section	->setLabel('Section')
					->setRequired(true)
					->addValidator(new Zend_Validate_NotEmpty())
					->setMultiOptions($sect);
		$this->addElement($section);
		
		$annee = new Zend_Form_Element_Select('annee');
		$annee		->setLabel('School year')
					->setRequired(true)
					->addValidator(new Zend_Validate_NotEmpty())
					->setMultiOptions(array(''=>'','1'=>'1','2'=>'2','3'=>'3'));
		$this->addElement($annee);
		
		$name = new Zend_Form_Element_Text('groupe');
		$name	->setLabel('Group')
				->setRequired(true)
				->addFilter(new Zend_Filter_StringTrim())
				->addFilter(new Zend_Filter_StripTags())
				->addFilter(new Zend_Filter_HtmlEntities())
				->addValidator(new Zend_Validate_NotEmpty())
				->addValidator('regex',false,array('/^[A-Z]{1}[1-9]{0,1}$/i'));
		$this->addElement($name);
		
		$submit = new Zend_Form_Element_Submit('submit');
		$submit	->setLabel('Send');
		$this->addElement($submit);
		
	}
}